<template>
  <div class="supplierProfile">
    <a-card class="general-card" title="图书馆系统查询">
      <a-form class="formHeader">
        <a-row justify="start" :gutter="24">
          <a-col class="formHeader-criteria">
            <a-row :gutter="24">
              <a-col span="6">
                <a-form-item label="品号" label-col-flex="80px">
                  <a-input v-model="checkFrom.mb001" @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="6">
                <a-form-item label="品名" label-col-flex="80px">
                  <a-input v-model="checkFrom.mb002" @keyup.enter="init" />
                </a-form-item>
              </a-col>
            </a-row>
          </a-col>
        </a-row>
      </a-form>

      <formButtonGroup v-model:columns="columns" v-model:size="size" :config="config" @refresh="init" />
      <a-table
        :loading="loading"
        :pagination="pagination"
        :columns="columns"
        :data="tabelList"
        :bordered="false"
        :size="size"
        @page-change="handlePageChange"
        @page-size-change="handlePageSizeChange"
      >
        <template #option="{ record }">
          <a-space>
            <a-button type="primary" size="mini" @click="opArticleNumber(record)"> 查看详情 </a-button>
            <!-- <a-button type="primary" size="mini" @click="opArticleNumber"> 查看图片 </a-button>
            <a-button type="primary" size="mini" @click="opArticleNumber"> 查看PDF </a-button> -->
          </a-space>
        </template>
      </a-table>
    </a-card>
  </div>
</template>

<script lang="ts">
import { toRefs } from 'vue';
import importConfig from './libraryList';
import searchBar from '@com/searchBar/searchBar.vue';
import formButtonGroup from '@com/formButtonGroup/formButtonGroup.vue';
export default {
  components: {
    searchBar,
    formButtonGroup,
  },
  setup() {
    const { base, opArticleNumber, init, tapDate, handlePageChange, handlePageSizeChange } = importConfig();
    init();
    return {
      ...toRefs(base),
      opArticleNumber,
      init,
      tapDate,
      handlePageChange,
      handlePageSizeChange,
    };
  },
};
</script>

<style scoped lang="less"></style>
